class CreateComments < ActiveRecord::Migration
  def self.up
    create_table :comments do |t|
      t.string        :name,      :limit => 50
      t.string        :email,     :limit => 100
      t.string        :body,      :limit => 1000
      t.references    :commentable, :polymorphic => true
      t.timestamps
    end
    
    add_index :comments, [:commentable_type, :commentable_id]
  end

  def self.down
    drop_table :comments
  end
end
